Skip to content

feat(opencode): add opt-in assistant auto-continue#18157

Closed
anduimagui wants to merge 1 commit intoanomalyco:devfrom
anduimagui:feat/assistant-auto-continue
Closed

feat(opencode): add opt-in assistant auto-continue#18157
anduimagui wants to merge 1 commit intoanomalyco:devfrom
anduimagui:feat/assistant-auto-continue

Conversation

@anduimagui
Copy link
Contributor

Issue for this PR

Closes #18156

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This adds an opt-in experimental.auto_continue config that watches finalized assistant messages for narrow continuation phrases like "If you'd like, I can continue." When a match is found on the latest assistant reply, OpenCode sends a synthetic follow-up prompt such as Yes. Do this. so the session can keep moving without a redundant user turn.

The implementation hooks into message.updated, dedupes by assistant message ID, only checks the latest assistant message in the session, and keeps the prompt text plus regex list configurable. I also included a small run client fix so the local CLI path correctly passes auth headers and the working directory to the SDK client, which was required to verify the end-to-end flow in real opencode run sessions.

How did you verify your code works?

  • Ran bun run typecheck in packages/opencode
  • Ran bun test test/session/autocontinue.test.ts test/config/config.test.ts --filter "AutoContinue|experimental.auto_continue" in packages/opencode
  • Ran live bun run --conditions=browser ./src/index.ts run ... checks in packages/opencode to verify new sessions, follow-up sessions, and auto-continue behavior end to end

Screenshots / recordings

Not included (non-UI change).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@jensenojs
Copy link
Contributor

Is this feature a subset of what's expected in this issue?

@anduimagui
Copy link
Contributor Author

Doing my part to reduce PR burden and close out work that probably fits better as a plugin than core.

I dug into the plugin API a bit more and it looks like this should be possible as an external npm-style OpenCode plugin, which feels like a better home for this behavior anyway. I’m going to move forward with that approach as a separate project I can track independently, so I’m closing this PR for now.

If it turns out I hit a hard blocker in the plugin system, I can reopen the conversation with specifics.

@anduimagui anduimagui closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Opt-in assistant auto-continue for generic continuation prompts

2 participants